<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <div class="error-code">404</div>
      <div class="error-message">抱歉，您访问的页面不存在</div>
      <div class="error-description">
        可能的原因：<br>
        • 页面已被删除或移动<br>
        • 输入的网址不正确<br>
        • 页面暂时无法访问
      </div>
      <div class="action-buttons">
        <el-button type="primary" size="large" @click="goHome">
          <el-icon><HomeFilled /></el-icon>
          返回首页
        </el-button>
        <el-button size="large" @click="goBack">
          <el-icon><ArrowLeft /></el-icon>
          返回上页
        </el-button>
        <el-button size="large" @click="reloadPage">
          <el-icon><Refresh /></el-icon>
          刷新页面
        </el-button>
      </div>
      <div class="quick-links">
        <h3>快速导航</h3>
        <div class="links-container">
          <el-card 
            v-for="link in quickLinks" 
            :key="link.path"
            class="link-card"
            shadow="hover"
            @click="navigateTo(link.path)"
          >
            <div class="link-content">
              <el-icon class="link-icon" :color="link.color">
                <component :is="link.icon" />
              </el-icon>
              <div class="link-info">
                <div class="link-title">{{ link.title }}</div>
                <div class="link-desc">{{ link.description }}</div>
              </div>
            </div>
          </el-card>
        </div>
      </div>
    </div>
    
    <!-- 背景动画 -->
    <div class="background-animation">
      <div class="bubble bubble-1"></div>
      <div class="bubble bubble-2"></div>
      <div class="bubble bubble-3"></div>
      <div class="bubble bubble-4"></div>
      <div class="bubble bubble-5"></div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { 
  HomeFilled, 
  ArrowLeft, 
  Refresh, 
  User, 
  Setting, 
  DataBoard,
  ShoppingCart 
} from '@element-plus/icons-vue'

const router = useRouter()

// 快速导航链接
const quickLinks = ref([
  {
    title: '仪表盘',
    description: '查看系统概览和数据统计',
    path: '/',
    icon: DataBoard,
    color: '#409EFF'
  },
  {
    title: '用户管理',
    description: '管理系统用户和权限',
    path: '/user/list',
    icon: User,
    color: '#67C23A'
  },
  {
    title: '系统设置',
    description: '配置系统参数和菜单',
    path: '/system/menu',
    icon: Setting,
    color: '#E6A23C'
  }
])

// 返回首页
const goHome = () => {
  router.push('/')
}

// 返回上一页
const goBack = () => {
  router.back()
}

// 刷新页面
const reloadPage = () => {
  window.location.reload()
}

// 导航到指定页面
const navigateTo = (path) => {
  router.push(path)
}
</script>

<style scoped>
.not-found-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.not-found-content {
  text-align: center;
  color: #fff;
  z-index: 10;
  max-width: 800px;
  width: 100%;
}

.error-code {
  font-size: 120px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 20px;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-message {
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.error-description {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 40px;
  opacity: 0.9;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.action-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.action-buttons .el-button {
  border-radius: 25px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.action-buttons .el-button:not(.el-button--primary) {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.action-buttons .el-button:not(.el-button--primary):hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.action-buttons .el-button--primary {
  box-shadow: 0 4px 15px rgba(64, 158, 255, 0.4);
}

.action-buttons .el-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(64, 158, 255, 0.6);
}

.quick-links h3 {
  font-size: 24px;
  margin-bottom: 24px;
  font-weight: 500;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.links-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.link-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.link-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.link-content {
  display: flex;
  align-items: center;
  padding: 20px;
  color: #fff;
}

.link-icon {
  font-size: 32px;
  margin-right: 16px;
  flex-shrink: 0;
}

.link-info {
  text-align: left;
}

.link-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
}

.link-desc {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.4;
}

/* 背景动画 */
.background-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 15s infinite ease-in-out;
}

.bubble-1 {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.bubble-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 80%;
  animation-delay: -2s;
}

.bubble-3 {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: -4s;
}

.bubble-4 {
  width: 100px;
  height: 100px;
  top: 30%;
  left: 70%;
  animation-delay: -6s;
}

.bubble-5 {
  width: 70px;
  height: 70px;
  top: 70%;
  left: 60%;
  animation-delay: -8s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
  }
  50% {
    transform: translateY(-40px) rotate(180deg);
  }
  75% {
    transform: translateY(-20px) rotate(270deg);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .error-code {
    font-size: 80px;
  }
  
  .error-message {
    font-size: 24px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .action-buttons .el-button {
    width: 200px;
  }
  
  .links-container {
    grid-template-columns: 1fr;
  }
  
  .link-content {
    padding: 16px;
  }
  
  .link-icon {
    font-size: 24px;
    margin-right: 12px;
  }
  
  .link-title {
    font-size: 16px;
  }
  
  .link-desc {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .error-code {
    font-size: 60px;
  }
  
  .error-message {
    font-size: 20px;
  }
  
  .error-description {
    font-size: 14px;
  }
  
  .not-found-container {
    padding: 10px;
  }
}
</style>